<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>

<f:loadBundle basename="demo.bundle.Messages" var="msg"/>

<html>
<head>
<title>Semantic CBR Code Search</title> 
<style type="text/css">
.odd-row {
    background-color: #ECF3FE;
}
.even-row {
    background-color: #FCFFFE;
}
.active-row {
    background-color: #FFEBDA;
}

.cell { 
	width: 25%;
	vertical-align:top;
}
.cell_10 { 
	width: 10%;
	vertical-align:top;
}
.cell_15 { 
	width: 15%;
	vertical-align:top;
}
.cell_20 { 
	width: 20%;
	vertical-align:top;
}
.cell_25 { 
	width: 25%;
	vertical-align:top;
}
.cell_35 { 
	width: 35%;
	vertical-align:top;
}
.cell_50 { 
	width: 50%;
	vertical-align:top;
}

.rsTitle { 
	padding: 5px;

	font-weight: bold;
	font-variant: small-caps;

	background-color: #E0ECF8;
	background-repeat: repeat-x;
	background-position: center;
}

.rsPanel {
	top: auto;
}

.rsLabel {
	font-size: 12px;
}

.rsInput {
	size: 220px;
	border-style: solid;
	border-width: 1px;
}

.rsButton {
	border-width: 2px;
}

.rsMessage {
	color: red;
	text-align: center;
}

</style>
</head>
<body>
<f:subview id="codeSearhForm">
	<a4j:form>
		<rich:panel>
			<rich:simpleTogglePanel id="togglePanelClase" switchType="client" label="#{msg.csForm_tgPanel_clase_label}" >
				<h:panelGrid styleClass="rsTitle" columns="4" columnClasses="cell_15, cell_35, cell_25, cell_25" width="100%">
					<h:outputText styleClass="rsLabel" value="#{msg.csForm_label_cName}" />
					<h:outputText styleClass="rsLabel" value="#{msg.csForm_label_cValue}" />
					<h:outputText styleClass="rsLabel" value="#{msg.csForm_label_cSemantic}" />
					<h:outputText styleClass="rsLabel" value="#{msg.csForm_label_cWeight}" />
				</h:panelGrid>
				<rich:separator height="1" lineType="solid"/><br/>
				<h:panelGrid columns="4" columnClasses="cell_15, cell_35, cell_25, cell_25" width="100%">
					<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_classType}" for="classType" />
					<rich:comboBox width="160px" id="classType" value="#{codeSearchBean.classType.stringValue}">
						<f:selectItems value="#{codeSearchBean.classTypeList}"/>
					</rich:comboBox>
					<h:outputText/>
					<rich:inputNumberSpinner id="weightCType" value="#{codeSearchBean.classType.weight}" minValue="0" maxValue="1" step="0.1" />

					<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_classPackage}" for="classPackage" />
					<h:inputText styleClass="rsInput" id="classPackage" value="#{codeSearchBean.classPackage.stringValue}" >
						<f:validator validatorId="javaValidator"/>
                    	<rich:ajaxValidator event="submit"/>
					</h:inputText>
					<h:outputText/>
					<rich:inputNumberSpinner id="weightCPackage" value="#{codeSearchBean.classPackage.weight}" minValue="0" maxValue="1" step="0.1" />

					<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_className}" for="className" />
					<h:inputText styleClass="rsInput" id="className" value="#{codeSearchBean.className.stringValue}" >
						<f:validator validatorId="javaValidator"/>
                    	<rich:ajaxValidator event="submit"/>
					</h:inputText>
					<h:selectBooleanCheckbox id="semanticCName" value="#{codeSearchBean.className.semantic}"/>
					<rich:inputNumberSpinner id="weightCName" value="#{codeSearchBean.className.weight}" minValue="0" maxValue="1" step="0.1" />
				</h:panelGrid>
				<br/><rich:separator height="2" lineType="solid"/><br/>
				<h:panelGrid columns="4" columnClasses="cell_15, cell_35, cell_25, cell_25" width="100%">
					<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_classImplements}" for="classImplements" />
					<h:panelGroup>
						<h:inputText styleClass="rsInput" id="classImplements" binding="#{codeSearchBean.implement}" />
						<a4j:commandButton id="addImplements" value="#{msg.csForm_button_add}" reRender="implementList, classImplements" actionListener="#{codeSearchBean.listenerAddImplements}" immediate="true" />
						<a4j:commandButton id="delImplements" value="#{msg.csForm_button_del}" reRender="implementList, classImplements" actionListener="#{codeSearchBean.listenerDelImplements}" immediate="true" />
					</h:panelGroup>
					<h:inputTextarea styleClass="rsLabel" rows="1" readonly="true" value="#{codeSearchBean.implementList}" id="implementList" />
					<rich:inputNumberSpinner id="weightCImplements" value="#{codeSearchBean.classImplements.weight}" minValue="0" maxValue="1" step="0.1" />

					<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_classExtend}" for="classExtend" />
					<h:inputText styleClass="rsInput" id="classExtend" value="#{codeSearchBean.classExtend.stringValue}" />
					<h:outputText/>
					<rich:inputNumberSpinner id="weightCExtend" value="#{codeSearchBean.classExtend.weight}" minValue="0" maxValue="1" step="0.1" />
				</h:panelGrid>
			</rich:simpleTogglePanel>
			<br/>
			<rich:simpleTogglePanel id="togglePanelMetodo" switchType="client" label="#{msg.csForm_tgPanel_method_label}" opened="true">
				<h:panelGrid styleClass="rsTitle" columns="4" columnClasses="cell_15, cell_35, cell_25, cell_25" width="100%">
					<h:outputText styleClass="rsLabel" value="#{msg.csForm_label_cName}" />
					<h:outputText styleClass="rsLabel" value="#{msg.csForm_label_cValue}" />
					<h:outputText styleClass="rsLabel" value="#{msg.csForm_label_cSemantic}" />
					<h:outputText styleClass="rsLabel" value="#{msg.csForm_label_cWeight}" />
				</h:panelGrid>
				<rich:separator height="1" lineType="solid"/><br/>
				<h:panelGrid columns="4" columnClasses="cell_15, cell_35, cell_25, cell_25" width="100%">
					<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_methodAction}" for="methodAction" />
					<h:inputText styleClass="rsInput" id="methodAction" value="#{codeSearchBean.methodAction.stringValue}" >
						<f:validator validatorId="javaValidator"/>
                    	<rich:ajaxValidator event="submit"/>
					</h:inputText>
					<h:selectBooleanCheckbox id="semanticMAction" value="#{codeSearchBean.methodAction.semantic}"/>
					<rich:inputNumberSpinner id="weightMAction" value="#{codeSearchBean.methodAction.weight}" minValue="0" maxValue="1" step="0.1" />

					<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_methodObject}" for="methodObject" />
					<h:inputText styleClass="rsInput" id="methodObject" value="#{codeSearchBean.methodObject.stringValue}" >
						<f:validator validatorId="javaValidator"/>
                    	<rich:ajaxValidator event="submit"/>
					</h:inputText>
					<h:selectBooleanCheckbox id="semanticMObject" value="#{codeSearchBean.methodObject.semantic}" />
					<rich:inputNumberSpinner id="weightMObject" value="#{codeSearchBean.methodObject.weight}" minValue="0" maxValue="1" step="0.1" />

					<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_methodReturn}" for="methodReturn" />
					<h:inputText styleClass="rsInput" id="methodReturn" value="#{codeSearchBean.methodReturn.stringValue}" />
					<h:outputLabel/>
						<rich:inputNumberSpinner id="weightMReturn" value="#{codeSearchBean.methodReturn.weight}" minValue="0" maxValue="1" step="0.1" />
				</h:panelGrid>
				<br/><rich:separator height="2" lineType="solid"/><br/>
				<h:panelGrid columns="4" columnClasses="cell_15, cell_35, cell_25, cell_25" width="100%">
					<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_methodParameter}" for="methodParameter" />
					<h:panelGroup>
						<h:inputText styleClass="rsInput" id="methodParameter" binding="#{codeSearchBean.parameter}" />
						<a4j:commandButton id="addParameter" value="#{msg.csForm_button_add}" reRender="parameterList, methodParameter" actionListener="#{codeSearchBean.listenerAddParameter}" immediate="true" />
						<a4j:commandButton id="delParameter" value="#{msg.csForm_button_del}" reRender="parameterList, methodParameter" actionListener="#{codeSearchBean.listenerDelParameter}" immediate="true" />
					</h:panelGroup>
					<h:inputTextarea styleClass="rsLabel" rows="1" readonly="true" value="#{codeSearchBean.parameterList}" id="parameterList" />
					<rich:inputNumberSpinner id="weightMParams" value="#{codeSearchBean.methodParams.weight}" minValue="0" maxValue="1" step="0.1" />

					<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_methodException}" for="methodException" />
					<h:panelGroup>
						<h:inputText styleClass="rsInput" id="methodException" binding="#{codeSearchBean.exception}" />
						<a4j:commandButton id="addException" value="#{msg.csForm_button_add}" reRender="exceptionList, methodException" actionListener="#{codeSearchBean.listenerAddException}" immediate="true" />
						<a4j:commandButton id="delException" value="#{msg.csForm_button_del}" reRender="exceptionList, methodException" actionListener="#{codeSearchBean.listenerDelException}" immediate="true" />
					</h:panelGroup>
					<h:inputTextarea styleClass="rsLabel" rows="1" readonly="true" value="#{codeSearchBean.exceptionList}" id="exceptionList" />
					<rich:inputNumberSpinner id="weightMExceptions" value="#{codeSearchBean.methodExceptions.weight}" minValue="0" maxValue="1" step="0.1" />
				</h:panelGrid>
			</rich:simpleTogglePanel>
			<br/>
			<rich:simpleTogglePanel id="togglePanelMasDatos" label="#{msg.csForm_tgPanel_more_label}" switchType="client" opened="false">
				<h:panelGrid id="gridMasDatos" columns="2" columnClasses="cell_50, cell_50" width="100%">
					<!-- Columna 1 - Visibilidad Clase -->
					<rich:simpleTogglePanel id="panelCVisibility" styleClass="rsPanel" label="#{msg.csForm_header_cVisibility}" switchType="client">
						<h:panelGrid styleClass="rsTitle" columns="3" columnClasses="cell_20, cell_15, cell_15" width="100%">
							<h:outputText styleClass="rsLabel" value="#{msg.csForm_label_cName}" />
							<h:outputText styleClass="rsLabel" value="#{msg.csForm_label_cValue}" />
							<h:outputText styleClass="rsLabel" value="#{msg.csForm_label_cWeight}" />
						</h:panelGrid>
						<rich:separator height="1" lineType="solid"/><br/>
						<h:panelGrid columns="3" columnClasses="cell_20, cell_15, cell_15" width="100%">
							<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_classIsPublic}" for="classIsPublic" />
							<h:selectOneMenu styleClass="rsInput" id="classIsPublic" value="#{codeSearchBean.classIsPublic.booleanValue}" >
								<f:selectItems value="#{codeSearchBean.yes_noList}"/>
							</h:selectOneMenu>
							<rich:inputNumberSpinner id="weightCIsPublic" value="#{codeSearchBean.classIsPublic.weight}" minValue="0" maxValue="1" step="0.1" />
							<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_classIsProtected}" for="classIsProtected" />
							<h:selectOneMenu styleClass="rsInput" id="classIsProtected" value="#{codeSearchBean.classIsProtected.booleanValue}" >
								<f:selectItems value="#{codeSearchBean.yes_noList}"/>
							</h:selectOneMenu>
							<rich:inputNumberSpinner id="weightCIsProtected" value="#{codeSearchBean.classIsProtected.weight}" minValue="0" maxValue="1" step="0.1" />
							<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_classIsPrivate}" for="classIsPrivate" />
							<h:selectOneMenu styleClass="rsInput" id="classIsPrivate" value="#{codeSearchBean.classIsPrivate.booleanValue}" >
								<f:selectItems value="#{codeSearchBean.yes_noList}"/>
							</h:selectOneMenu>
							<rich:inputNumberSpinner id="weightCIsPrivate" value="#{codeSearchBean.classIsPrivate.weight}" minValue="0" maxValue="1" step="0.1" />
						</h:panelGrid>
					</rich:simpleTogglePanel>
					<!-- Columna 2 - Visibilidad Metodo -->
					<rich:simpleTogglePanel id="panelMVisibility" styleClass="rsPanel" label="#{msg.csForm_header_mVisibility}" switchType="client">
						<h:panelGrid styleClass="rsTitle" columns="3" columnClasses="cell_20, cell_15, cell_15" width="100%">
							<h:outputText styleClass="rsLabel" value="#{msg.csForm_label_cName}" />
							<h:outputText styleClass="rsLabel" value="#{msg.csForm_label_cValue}" />
							<h:outputText styleClass="rsLabel" value="#{msg.csForm_label_cWeight}" />
						</h:panelGrid>
						<rich:separator height="1" lineType="solid"/><br/>
						<h:panelGrid columns="3" columnClasses="cell_20, cell_15, cell_15" width="100%">
							<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_methodIsPublic}" for="methodIsPublic" />
							<h:selectOneMenu styleClass="rsInput" id="methodIsPublic" value="#{codeSearchBean.methodIsPublic.booleanValue}" >
								<f:selectItems value="#{codeSearchBean.yes_noList}"/>
							</h:selectOneMenu>
							<rich:inputNumberSpinner id="weightMIsPublic" value="#{codeSearchBean.methodIsPublic.weight}" minValue="0" maxValue="1" step="0.1" />
							<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_methodIsProtected}" for="methodIsProtected" />
							<h:selectOneMenu styleClass="rsInput" id="methodIsProtected" value="#{codeSearchBean.methodIsProtected.booleanValue}" >
								<f:selectItems value="#{codeSearchBean.yes_noList}"/>
							</h:selectOneMenu>
							<rich:inputNumberSpinner id="weightMIsProtected" value="#{codeSearchBean.methodIsProtected.weight}" minValue="0" maxValue="1" step="0.1" />
							<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_methodIsPrivate}" for="methodIsPrivate" />
							<h:selectOneMenu styleClass="rsInput" id="methodIsPrivate" value="#{codeSearchBean.methodIsPrivate.booleanValue}" >
								<f:selectItems value="#{codeSearchBean.yes_noList}"/>
							</h:selectOneMenu>
							<rich:inputNumberSpinner id="weightMIsPrivate" value="#{codeSearchBean.methodIsPrivate.weight}" minValue="0" maxValue="1" step="0.1" />
						</h:panelGrid>
					</rich:simpleTogglePanel>
					<!-- Columna 1 - Modificadores Clase -->
					<rich:simpleTogglePanel id="panelCModifiers" styleClass="rsPanel" label="#{msg.csForm_header_cModifiers}" switchType="client" opened="false">
						<h:panelGrid styleClass="rsTitle" columns="3" columnClasses="cell_20, cell_15, cell_15" width="100%">
							<h:outputText styleClass="rsLabel" value="#{msg.csForm_label_cName}" />
							<h:outputText styleClass="rsLabel" value="#{msg.csForm_label_cValue}" />
							<h:outputText styleClass="rsLabel" value="#{msg.csForm_label_cWeight}" />
						</h:panelGrid>
						<rich:separator height="1" lineType="solid"/><br/>
						<h:panelGrid columns="3" columnClasses="cell_20, cell_15, cell_15" width="100%">
							<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_classIsAbstract}" for="classIsAbstract" />
							<h:selectOneMenu styleClass="rsInput" id="classIsAbstract" value="#{codeSearchBean.classIsAbstract.booleanValue}" >
								<f:selectItems value="#{codeSearchBean.yes_noList}"/>
							</h:selectOneMenu>
							<rich:inputNumberSpinner id="weightCIsAbstract" value="#{codeSearchBean.classIsAbstract.weight}" minValue="0" maxValue="1" step="0.1" />
							<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_classIsFinal}" for="classIsFinal" />
							<h:selectOneMenu styleClass="rsInput" id="classIsFinal" value="#{codeSearchBean.classIsFinal.booleanValue}" >
								<f:selectItems value="#{codeSearchBean.yes_noList}"/>
							</h:selectOneMenu>
							<rich:inputNumberSpinner id="weightCIsFinal" value="#{codeSearchBean.classIsFinal.weight}" minValue="0" maxValue="1" step="0.1" />
							<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_classIsStrictfp}" for="classIsStrictfp" />
							<h:selectOneMenu styleClass="rsInput" id="classIsStrictfp" value="#{codeSearchBean.classIsStrictfp.booleanValue}" >
								<f:selectItems value="#{codeSearchBean.yes_noList}"/>
							</h:selectOneMenu>
							<rich:inputNumberSpinner id="weightCIsStrictfp" value="#{codeSearchBean.classIsStrictfp.weight}" minValue="0" maxValue="1" step="0.1" />
						</h:panelGrid>
					</rich:simpleTogglePanel>
					<!-- Columna 2 - Modificadores Metodo -->
					<rich:simpleTogglePanel id="panelMModifiers" styleClass="rsPanel" label="#{msg.csForm_header_mModifiers}" switchType="client" opened="false">
						<h:panelGrid styleClass="rsTitle" columns="3" columnClasses="cell_20, cell_15, cell_15" width="100%">
							<h:outputText styleClass="rsLabel" value="#{msg.csForm_label_cName}" />
							<h:outputText styleClass="rsLabel" value="#{msg.csForm_label_cValue}" />
							<h:outputText styleClass="rsLabel" value="#{msg.csForm_label_cWeight}" />
						</h:panelGrid>
						<rich:separator height="1" lineType="solid"/><br/>
						<h:panelGrid columns="3" columnClasses="cell_20, cell_15, cell_15" width="100%">
							<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_methodIsAbstract}" for="methodIsAbstract" />
							<h:selectOneMenu styleClass="rsInput" id="methodIsAbstract" value="#{codeSearchBean.methodIsAbstract.booleanValue}" >
								<f:selectItems value="#{codeSearchBean.yes_noList}"/>
							</h:selectOneMenu>
							<rich:inputNumberSpinner id="weightMIsAbstract" value="#{codeSearchBean.methodIsAbstract.weight}" minValue="0" maxValue="1" step="0.1" />
							<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_methodIsFinal}" for="methodIsFinal" />
							<h:selectOneMenu styleClass="rsInput" id="methodIsFinal" value="#{codeSearchBean.methodIsFinal.booleanValue}" >
								<f:selectItems value="#{codeSearchBean.yes_noList}"/>
							</h:selectOneMenu>
							<rich:inputNumberSpinner id="weightMIsFinal" value="#{codeSearchBean.methodIsFinal.weight}" minValue="0" maxValue="1" step="0.1" />
							<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_methodIsStrictfp}" for="methodIsStrictfp" />
							<h:selectOneMenu styleClass="rsInput" id="methodIsStrictfp" value="#{codeSearchBean.methodIsStrictfp.booleanValue}" >
								<f:selectItems value="#{codeSearchBean.yes_noList}"/>
							</h:selectOneMenu>
							<rich:inputNumberSpinner id="weightMIsStrictfp" value="#{codeSearchBean.methodIsStrictfp.weight}" minValue="0" maxValue="1" step="0.1" />
							<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_methodIsNative}" for="methodIsNative" />
							<h:selectOneMenu styleClass="rsInput" id="methodIsNative" value="#{codeSearchBean.methodIsNative.booleanValue}" >
								<f:selectItems value="#{codeSearchBean.yes_noList}"/>
							</h:selectOneMenu>
							<rich:inputNumberSpinner id="weightMIsNative" value="#{codeSearchBean.methodIsNative.weight}" minValue="0" maxValue="1" step="0.1" />
							<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_methodIsStatic}" for="methodIsStatic" />
							<h:selectOneMenu styleClass="rsInput" id="methodIsStatic" value="#{codeSearchBean.methodIsStatic.booleanValue}" >
								<f:selectItems value="#{codeSearchBean.yes_noList}"/>
							</h:selectOneMenu>
							<rich:inputNumberSpinner id="weightMIsStatic" value="#{codeSearchBean.methodIsStatic.weight}" minValue="0" maxValue="1" step="0.1" />
							<h:outputLabel styleClass="rsLabel" value="#{msg.csForm_label_methodIsSynchronized}" for="methodIsSynchronized" />
							<h:selectOneMenu styleClass="rsInput" id="methodIsSynchronized" value="#{codeSearchBean.methodIsSynchronized.booleanValue}" >
								<f:selectItems value="#{codeSearchBean.yes_noList}"/>
							</h:selectOneMenu>
							<rich:inputNumberSpinner id="weightMIsSynchronized" value="#{codeSearchBean.methodIsSynchronized.weight}" minValue="0" maxValue="1" step="0.1" />
						</h:panelGrid>
					</rich:simpleTogglePanel>
				</h:panelGrid>
			</rich:simpleTogglePanel>
			<br/>
			<rich:messages styleClass="rsMessage" infoClass="green" errorClass="red" />
			<br/>
			<!-- Contenedores -->
			<a4j:commandButton id="botonBuscar" styleClass="rsButton" value="#{msg.csForm_button_search}" action="#{codeSearchBean.search}" reRender="tabPanelBusqueda" />
			<a4j:commandButton id="botonLimpiar" styleClass="rsButton" value="#{msg.csForm_button_clean}" action="#{codeSearchBean.clean}" type="reset" reRender="tabPanelBusqueda" />
			<a4j:commandButton id="botonSalir" styleClass="rsButton" value="#{msg.csForm_button_exit}" action="#{codeSearchBean.exit}" />
		</rich:panel>
	</a4j:form>
</f:subview>
</body>
</html>
